﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Debugging.Form2
{
    class Model : ModelBase
    {
        public override void PersistChanges()
        {
            string message = String.Format("Changes Persisted for {0} {1}.", Customer.FirstName, Customer.LastName);
            OnNotifyUser(new NotifyUserEventArgs(message));
            this.AcceptEnabled = false;
        }

        public override void Navigate()
        {
            OnNotifyUser(new NotifyUserEventArgs("Navigating..."));
        }

        public override void Show()
        {
            this.AcceptEnabled = true;
            this.Customer = new CustomerDataContract();
            this.Customer.FirstName = "James";
            this.Customer.LastName = "Walter";

            OnShow(EventArgs.Empty);
        }
    }
}
